package com.atguigu.spring6.iocxml.di;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestBook {

    @Test
    public void testSetter() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beandi.xml");
        Book book = applicationContext.getBean("book",Book.class);
        System.out.println(book);
    }

    @Test
    public void testConstructor() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beandi.xml");
        Book book = applicationContext.getBean("bookCon",Book.class);
        System.out.println(book);
    }
}
